<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<!-- Main Sidebar Container -->
<aside th:fragment="sidebar-fragment(path)" class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a th:href="@{/}" class="brand-link">
        <img th:src="@{/blog/dist/img/blog.png}" alt="Blog Logo" class="brand-image img-circle elevation-3"
             style="opacity: .8" >
        <span class="brand-text font-weight-light"><b>L</b>Blog</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
        <!-- Sidebar user panel (optional) -->
        <div class="user-panel mt-3 pb-3 mb-3 d-flex">
            <div class="image">
                <img th:src="@{/admin/dist/img/user2-160x160.jpg}"  class="img-circle elevation-2" alt="User Image">
            </div>
            <div class="info">
                <a href="#" class="d-block">林北</a>
            </div>
        </div>

        <!-- Sidebar Menu -->
        <nav class="mt-2">
            <ul id="SidebarMenu" class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
                <!-- Add icons to the links using the .nav-icon class
                     with font-awesome or any other icon font library -->
                <li class="nav-item">
                    <a th:href="@{/admin/index}" th:class="${path} == 'index'?'nav-link active':'nav-link'">
                        <i class="fas fa-home"></i>
                        <p>
                            首页
                        </p>
                    </a>
                </li>
                <li class="nav-item">
                    <a  sec:authorize="hasRole('ROLE_ADMIN')"  th:href="@{/admin/historicalViews}"  th:class="${path} == 'historicalViews'?'nav-link active':'nav-link'">
                        <i class="fas fa-chart-line"></i>
                        <p>
                            历史浏览量
                        </p>
                    </a>
                </li>
                <li class="nav-item">
                    <a th:href="@{/admin/editors}"  th:class="${path} == 'editors'?'nav-link active':'nav-link'">
                        <i class="fas fa-edit"></i>
                        <p>
                            发布博客
                        </p>
                    </a>
                </li>
                <li class="nav-item">
                    <a th:href="@{/admin/manager}" th:class="${path} == 'manager'?'nav-link active':'nav-link'">
                        <i class="fas fa-list"></i>
                        <p>
                            博客管理
                        </p>
                    </a>
                </li>
                <li class="nav-item">
                    <a th:href="@{/admin/commentManager}" th:class="${path} == 'comment'?'nav-link active':'nav-link'">
                        <i class="far fa-comment"></i>
                        <p>
                            评论管理
                        </p>
                    </a>
                </li>
                <li class="nav-item">
                    <a th:href="@{/admin/sortManager}" th:class="${path} == 'sort'?'nav-link active':'nav-link'">
                        <i class="far fa-bookmark"></i>
                        <p>
                            分类管理
                        </p>
                    </a>
                </li>
                <li class="nav-item">
                    <a href="/logout" class="nav-link">
                        <i class="fas fa-sign-out-alt"></i>
                        <p>
                            返回博客
                        </p>
                    </a>
                </li>
            </ul>
        </nav>
        <!-- /.sidebar-menu -->
    </div>
    <!-- /.sidebar -->
</aside>

</html>